﻿<%@ Page Title="CTHS" Language="C#" MasterPageFile="~/main/masterpage/main_level1.Master"
    AutoEventWireup="true" CodeBehind="ctGiaDoanDuong.aspx.cs" Inherits="nkstdgia.main.ctGiaDoanDuong" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register Assembly="wsRK.wsControls" Namespace="wsRK.wsControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phd_content" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="webapplication_form_header">
                <div class="left">
                    <h1>
                        <asp:Label ID="lblTitle" runat="server">Phiếu giá cho từng Đoạn Đường</asp:Label>
                    </h1>
                </div>
            </div>
            <table class="option_table">
                <tr>
                    <td colspan="2">
                        <p style="color: Red">
                            <asp:Label ID="lblErrorMessge" runat="server"></asp:Label></p>
                    </td>
                </tr>
                <tr>
                    <td class="option_table_td_150 textright" style="vertical-align: top; font-weight: bold">
                        <span>Quận</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlQuan" runat="server" DataTextField="NOI_DUNG" DataValueField="MA_THAM_SO"
                            AutoPostBack="True" Width="200px" OnSelectedIndexChanged="ddlQuan_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="option_table_td_150 textright" style="vertical-align: top; font-weight: bold">
                        <span>Đường đã nhập</span>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlDuong" runat="server" DataTextField="DUONG" AutoPostBack="True"
                            Width="200px" OnSelectedIndexChanged="ddlDuong_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <%-- <tr>
                    <td class="option_table_td_150 textright" style="vertical-align: top; font-weight: bold">
                        <span>Giá đất</span>
                    </td>
                    <td>
                        <cc1:wsTxtDouble ID="txtGiaDat" Width="192px" runat="server" numberOfDecimals="3"></cc1:wsTxtDouble>&nbsp;<span
                            style="font-weight: bold"> Đơn vị tính: triệu VND</span>
                    </td>
                </tr>--%>
            </table>
            <div class="action_bar">
                <div class="right">
                    <cc1:wsBtnAction ID="btnAdd" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                        Visible="false" OnClientClick="javascript:Main.openPopup('system_popup1');"></cc1:wsBtnAction>
                </div>
            </div>
            <asp:ListView ID="lstGiaDat" runat="server" OnItemEditing="lstGiaDat_ItemEditing"
                OnItemCanceling="lstGiaDat_ItemCanceling" OnItemUpdating="lstGiaDat_ItemUpdating">
                <LayoutTemplate>
                    <table class="data_table">
                        <tr>
                            <th style="width: 40px">
                                #
                            </th>
                            <th>
                                Đoạn đường
                            </th>
                            <th style="width: 150px">
                                Giá trị (triệu VND)
                            </th>
                            <th style="width: 150px">
                                Người cập nhật
                            </th>
                            <th style="width: 200px">
                                Ngày cập nhật
                            </th>
                            <th style="width: 80px">
                                Chỉnh sửa
                            </th>
                            <th style="width: 80px">
                                Xóa
                            </th>
                            <th style="width: 80px">
                                Lịch sử
                            </th>
                        </tr>
                        <tr id="itemPlaceholder" runat="server">
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("RowNumber")%>
                        </td>
                        <td>
                            <%# Eval("DOAN_DUONG")%>
                            <asp:HiddenField ID="hdMA_GDD" runat="server" Value='<%# Eval("MA_GDD") %>' />
                            <asp:HiddenField ID="hdDOAN_DUONG" runat="server" Value='<%# Eval("DOAN_DUONG") %>' />
                            <asp:HiddenField ID="hdGIA_DAT" runat="server" Value='<%# Eval("GIA_DAT") %>' />
                        </td>
                        <td>
                            <%# Eval("GIA_DAT").ToString() == "0" ? "" : string.Format("{0:###,###,##0.00}", double.Parse(Eval("GIA_DAT").ToString()))%>
                        </td>
                        <td>
                            <%# Eval("NGUOI_KHOI_TAO_NAME")%>
                        </td>
                        <td>
                            <%# Eval("NGAY_CAP_NHAT")%>
                        </td>
                        <td>
                            <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/images/edit.png" Width="16px"
                                Height="16px" CommandName="Edit"></asp:ImageButton>
                        </td>
                        <td>
                            <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/images/delete.png" Width="16px"
                                Height="16px" OnClick="_btnDelete_Click" CommandArgument='<%# Eval("MA_GDD") %>'
                                OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:ImageButton>
                        </td>
                        <td>
                            <asp:ImageButton ID="btnHistory" runat="server" ImageUrl="~/images/ico-help.png"
                                Width="16px" Height="16px" OnClick="_btnHistory_Click" CommandArgument='<%# Eval("HISTORY") %>'>
                            </asp:ImageButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <EditItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("RowNumber")%>
                        </td>
                        <td>
                            <asp:TextBox ID="txtDOAN_DUONG" runat="server" Text='<%# Eval("DOAN_DUONG")%>' Width="95%"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                                ValidationGroup="UpdateDoanDuong" ControlToValidate="txtDOAN_DUONG">*</asp:RequiredFieldValidator>
                            <asp:HiddenField ID="hdMA_GDD" runat="server" Value='<%# Eval("MA_GDD") %>' />
                            <asp:HiddenField ID="hdGIA_DAT" runat="server" Value='<%# Eval("GIA_DAT") %>' />
                        </td>
                        <td>
                            <cc1:wsTxtDouble ID="txtGiaDat" runat="server" numberOfDecimals="3" Text='<%# Eval("GIA_DAT")%>'
                                Width="80px"></cc1:wsTxtDouble>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                ValidationGroup="UpdateDoanDuong" ControlToValidate="txtGiaDat">*</asp:RequiredFieldValidator>
                        </td>
                        <td>
                            <%# Eval("NGUOI_KHOI_TAO_NAME")%>
                        </td>
                        <td>
                            <%# Eval("NGAY_CAP_NHAT")%>
                        </td>
                        <td>
                            <asp:ImageButton ID="btnUpdate" runat="server" ImageUrl="~/images/edit.png" Width="16px"
                                Height="16px" CommandName="Update" ValidationGroup="UpdateDoanDuong"></asp:ImageButton>
                            <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/cancel.png" Width="16px"
                                Height="16px" CommandName="Cancel"></asp:ImageButton>
                        </td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <table class="data_table">
                        <tr>
                            <th style="width: 40px">
                                #
                            </th>
                            <th>
                                Đoạn đường
                            </th>
                            <th style="width: 150px">
                                Giá trị (triệu VND)
                            </th>
                            <th style="width: 150px">
                                Người cập nhật
                            </th>
                            <th style="width: 200px">
                                Ngày cập nhật
                            </th>
                            <th style="width: 80px">
                                Chỉnh sửa
                            </th>
                            <th style="width: 80px">
                                Xóa
                            </th>
                            <th style="width: 80px">
                                Lịch sử
                            </th>
                        </tr>
                        <tr>
                            <td colspan="8">
                                <label id="Label1" runat="server">
                                    <%= base.getValueFromLocale("NoData")%></label>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:ListView>
            <div class="action_bar">
                <div class="left" style="margin-top: 5px">
                    <asp:Label ID="lblHistory" runat="server">Lịch sử</asp:Label>
                </div>
            </div>
            <asp:ListView ID="lvHistory" runat="server">
                <LayoutTemplate>
                    <table class="data_table">
                        <tr>
                            <th style="width: 40px">
                                #
                            </th>
                            <th style="width: 150px">
                                Ngày/Tháng/Năm
                            </th>
                            <th>
                                Giá trị (triệu VND)
                            </th>
                        </tr>
                        <tr id="itemPlaceholder" runat="server">
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <%# Eval("RowNumber") %>
                        </td>
                        <td>
                            <%# Eval("Date")%>
                        </td>
                        <td>
                            <%# Eval("Value")%>
                        </td>
                    </tr>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <table class="data_table">
                        <tr>
                            <th style="width: 40px">
                                #
                            </th>
                            <th style="width: 150px">
                                Ngày/Tháng/Năm
                            </th>
                            <th>
                                Giá trị (triệu VND)
                            </th>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <label id="Label1" runat="server">
                                    <%= base.getValueFromLocale("NoData")%></label>
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
            </asp:ListView>
            <div id="system_popup1">
                <div class="action_bar" style="margin-left: 5px">
                    <div class="right ">
                        <cc1:wsBtnAction ID="btnTenDoanDuongPopup" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                            OnClick="btnTenDoanDuongPopup_Click" ValidationGroup="AddTenDoanDuong"></cc1:wsBtnAction>
                    </div>
                </div>
                <table class="option_table">
                    <tr>
                        <td class="option_table_td_100">
                            <asp:Label ID="lblName" runat="server">Tên đoạn đường</asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenDoanDuongPopup" runat="server" MaxLength="500"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                ValidationGroup="AddTenDoanDuong" ControlToValidate="txtTenDoanDuongPopup">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="">
                            <asp:Label>Giá đoạn đường</asp:Label>
                        </td>
                        <td>
                            <cc1:wsTxtDouble ID="txtGiaDatPopup" Width="192px" runat="server" numberOfDecimals="3"></cc1:wsTxtDouble>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                ValidationGroup="AddTenDoanDuong" ControlToValidate="txtGiaDatPopup">*</asp:RequiredFieldValidator>&nbsp;<span
                                    style="font-weight: bold"> Đơn vị tính: triệu VND</span>
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phd_footer" runat="server">
</asp:Content>
